package net.schastny.shopmanager.additional;

import java.beans.PropertyEditorSupport;

import net.schastny.shopmanager.domain.PreOrder;

public class PreOrderPropertyEditor extends PropertyEditorSupport {
    @Override
    public void setAsText(String text) {
        PreOrder preorder = new PreOrder();
        preorder.setPreorderId(Integer.parseInt(text));
        setValue(preorder);
    }
    
    @Override
    public String getAsText() {
        return String.valueOf(((PreOrder)getValue()).getPreorderId());
    }
}
